<template>
    <el-table :data="tableData" stripe style="width: 100%">
        <el-table-column prop="date" label="ID" width="180" />
        <el-table-column prop="name" label="名称" width="180">
            <template #default="scope">  
                <div v-if="scope.row.name=='Tom'">
                   <el-tag class="ml-2" type="error">{{scope.row.name}}</el-tag>
                </div>
                <div v-else>
                   <el-tag class="ml-2" type="info">{{scope.row.name}}</el-tag>
                </div>
            </template>
        </el-table-column>
        <el-table-column prop="address" label="地址" />
    </el-table>
</template>

<script lang="ts" setup>
const tableData = [
  {
    date: '1',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2',
    name: 'Tomxx',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '3',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '4',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
]
</script>
